package org.hgvc.webapp.ets.jsf.beans.agent;

import java.util.List;

import org.hgvc.webapp.ets.bo.Agreement;
import org.hgvc.webapp.ets.bo.MemberPointEntitle;
import org.hgvc.webapp.ets.spring.service.MemberService;
import org.jocsb.base.AbstractBean;
import org.jocsb.base.exception.BaseException;


public class AgentMemberAgreementPointEnquiryBean extends AbstractBean {

	public static final String BEAN_NAME="agentMemberAgreementPointEnquiryBean";
	public static final String NAV_LIST="agentMemberViewAgreementPoint";
	
	private MemberService service;
	private Agreement agreement;
	private List<MemberPointEntitle> pointList;
	
	
	public Agreement getAgreement() {
		return agreement;
	}

	public void setAgreement(Agreement agreement) {
		this.agreement = agreement;
	}

	public void setService(MemberService service) {
		this.service = service;
	}
	
	public List<MemberPointEntitle> getPointList() {
		try{
			pointList = service.getMemberPointEntitleList(agreement.getAgreementId());
		}catch(BaseException be){
			be.printStackTrace();
			initErrorBean(be);
		}
		return pointList;
	}
	
	public String navListAction(Agreement agreement){
		this.agreement = agreement;
		return NAV_LIST;
	}
	
	
}